﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.SplashScreen
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>Provides an interface to the Unity splash screen.</para>
  /// </summary>
  [NativeHeader("Runtime/Graphics/DrawSplashScreenAndWatermarks.h")]
  public class SplashScreen
  {
    /// <summary>
    ///   <para>Returns true once the splash screen has finished. This is once all logos have been shown for their specified duration.</para>
    /// </summary>
    public static extern bool isFinished { [FreeFunction("IsSplashScreenFinished"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    [FreeFunction]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void CancelSplashScreen();

    [FreeFunction]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void BeginSplashScreenFade();

    /// <summary>
    ///   <para>Initializes the splash screen so it is ready to begin drawing. Call this before you start calling Rendering.SplashScreen.Draw. Internally this function resets the timer and prepares the logos for drawing.</para>
    /// </summary>
    [FreeFunction("BeginSplashScreen_Binding")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void Begin();

    public static void Stop(SplashScreen.StopBehavior stopBehavior)
    {
      if (stopBehavior == SplashScreen.StopBehavior.FadeOut)
        SplashScreen.BeginSplashScreenFade();
      else
        SplashScreen.CancelSplashScreen();
    }

    /// <summary>
    ///   <para>Immediately draws the splash screen. Ensure you have called Rendering.SplashScreen.Begin before you start calling this.</para>
    /// </summary>
    [FreeFunction("DrawSplashScreen_Binding")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void Draw();

    [FreeFunction("SetSplashScreenTime")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void SetTime(float time);

    /// <summary>
    ///   <para>The behavior to apply when calling ParticleSystem.Stop|Stop.</para>
    /// </summary>
    public enum StopBehavior
    {
      /// <summary>
      ///   <para>Immediately stop rendering the SplashScreen.</para>
      /// </summary>
      StopImmediate,
      /// <summary>
      ///   <para>Jumps to the final stage of the Splash Screen and performs a fade from the background to the game.</para>
      /// </summary>
      FadeOut,
    }
  }
}
